class CoachOrder < ApplicationRecord
  belongs_to :member
  belongs_to :coach
  has_one :appointment, class_name: "TrainingAppointment", foreign_key: :order_id
  has_one :running_account, class_name: "PayCallback", foreign_key: :order_id, primary_key: :order_no
  enum status: {pending: 0, paid: 1, closed: 2, joined: 3, refunded: 5, deleted: 6, hidden: 7, late: 8, absent: 9}
  default_scope {where.not(delflg: 1)}
end
